package day019.ioStream;

import java.io.*;

public class BufferedStreamDemo1 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("D:\\ideaProjects\\javase_code\\study-practice\\" +
                "src\\day019\\ioStream\\day019_demo\\dog.jpg"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("D:\\ideaProjects\\javase_code\\study-practice\\" +
                "src\\day019\\ioStream\\day019_demo\\test5.jpg"));
//        int by;
//        while ((by = bis.read()) != -1) {
//            bos.write(by);
//        }

        byte[] bys = new byte[1024];
        int len;
        while ((len = bis.read(bys)) != -1) {
            bos.write(bys, 0, len);
        }

        bis.close();
        bos.close();
    }
}
